<?php
namespace app\modules\common\exceptions;

use app\modules\common\components\Api;
use Exception;
use Throwable;

class BusinessException extends Exception
{
    private $data;

    public function __construct($message = "", $code = Api::CODE_ERROR, $data = [], Throwable $previous = null)
    {
        parent::__construct($message, $code, $previous);
        $this->data = $data;
    }

    public function getData()
    {
        return $this->data;
    }
}
